package com.tianji.learning.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tianji.common.exceptions.BizIllegalException;
import com.tianji.learning.domain.po.TjNote;
import com.tianji.learning.mapper.InteractionNotesMapper;
import com.tianji.learning.service.InteractionNotesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


@Service
@Slf4j
public class InteractionNotesServiceImpl extends ServiceImpl<InteractionNotesMapper, TjNote> implements InteractionNotesService {


    @Override
    public void updateHidden(Long id, Boolean hidden) {
        log.info("updateHidden id:{}, hidden:{}", id, hidden);
        if (id == null && hidden == null){
            throw new BizIllegalException("参数或者不存在");
        }
        this.lambdaUpdate()
                .set(TjNote::getHidden, hidden)
                .eq(TjNote::getId, id)
                .update();
    }
}
